import request from '@/utils/request'
import type { ConsciousnessState } from './types'

// 意识状态API服务
export const consciousnessApi = {
  // 获取生命体的意识状态
  getByLifeEntityId(lifeEntityId: string): Promise<ConsciousnessState> {
    return request.get(`/consciousness/life-entity/${lifeEntityId}`)
  },

  // 创建意识状态
  create(data: Partial<ConsciousnessState>): Promise<ConsciousnessState> {
    return request.post('/consciousness', data)
  },

  // 更新意识状态
  update(id: string, data: Partial<ConsciousnessState>): Promise<ConsciousnessState> {
    return request.put(`/consciousness/${id}`, data)
  },

  // 获取意识状态历史
  getHistory(lifeEntityId: string): Promise<any> {
    return request.get(`/consciousness/life-entity/${lifeEntityId}/history`)
  }
}